(*****************************************************************************
 * Delphi Plug-in Framework (DPF)
 * Copyright (C) 2006-2007 Tao Yuan
 *
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the
 * License at http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
 * the specific language governing rights and limitations under the License.                                                               }
 *
 * The Initial Developer of the Original Code is Tao Yuan. Portions created by
 * Tao Yuan are Copyright (C) Tao Yuan (taoy.cn att gmail dott com)
 * All rights reserved.
 *****************************************************************************)

 unit RdPluginService;

interface

uses
  RDPluginRegistry;

type
  IPluginService = interface;
  IPluginInfo = interface;

  IPlugin = interface(IInterface)
  ['{99B81EE4-CF6C-4988-AE2C-AA60D63F7E8A}']
    function getName: string; stdcall;
    procedure Initialize(APluginService: IPluginService; APluginInfo: IPluginInfo); stdcall;
    procedure Start; stdcall;
    procedure Stop; stdcall;  
  end;

  IPluginInfo = interface(IInterface)
  ['{6663E243-50BF-4C7A-A457-BF4BCB103334}']

    function getDescriptor: IPluginDescriptor;
    function GetPlugin: IPlugin;
    procedure setDescriptor(Value: IPluginDescriptor);
    procedure SetPlugin(const Value: IPlugin);

    function isActive: Boolean;
    property Descriptor: IPluginDescriptor read getDescriptor write setDescriptor;
    property Plugin: IPlugin read GetPlugin write SetPlugin;
  end;

  IPluginService = interface(IInterface)
  ['{AC3EEF9E-6882-4C85-B786-11948B8B7423}']
    function ActivePlugin(APluginId: string): IPluginInfo; stdcall;
    procedure DeactivatePlugin(APluginID: string);
    function GetExtensionPoint(APluginInfo: IPluginInfo; APointId: string):
        IExtensionPoint; stdcall;
    function GetPlugin(APluginId: string): IPluginInfo; stdcall;
    function GetRegistry: IPluginRegistry; stdcall;
    function isBadPlugin(descr: IPluginDescriptor): Boolean; stdcall;
    function isPluginActivated(descr: IPluginDescriptor): boolean; stdcall;
    function isPluginActivating(descr: IPluginDescriptor): boolean; stdcall;
    function isPluginEnabled(descr: IPluginDescriptor): boolean; stdcall;
  end;

implementation

end.
